// 1. 反转字符串
pub fn reverse_string(s: &mut Vec<char>) -> Vec<char> {
    let mut left = 0;
    let mut right = s.len()-1;
    while left < right {
        s.swap(left, right);
        left += 1;
        right -= 1;
    }
    s.to_vec()
}

// 2. 字符串中的第一个唯一字符
pub fn first_uniq_char(s: &str) -> i32 {
    let mut arr = vec![0 as usize; 26];
    let a = 'a' as u8;
    for (i, c) in s.char_indices() {
        arr[(c as u8 - a) as usize] = i;
    }
    for (i, c) in s.char_indices() {
        if i == arr[(c as u8 - a) as usize] {
            return i as i32;
        }
    }
    -1
}
